/**
 *
 *! \file        _emvdctag_.h
 * \brief This module contains the definition of tags used by EMVDC component
 *
*
 * \author        SMO
 * \author Copyright (c) 2001 Sagem Monetel SA, rue claude Chappe,
 * \author 07503 Guilherand-Granges, France, All Rights Reserved.
 *
 * \author Sagem Monetel SA has intellectual property rights relating
 * \author to the technology embodied in this software.  In particular,
 * \author and without limitation, these intellectual property rights
 * \author may include one or more patents.
 *
 * \author This software is distributed under licenses restricting
 * \author its use, copying, distribution, and decompilation.
 * \author No part of this software may be reproduced in any form
 * \author by any means without prior written authorization of
 * \author Sagem Monetel.

 * \see    EMV 2000 - Level 2 requirements - Book 3, Annex A
 *
 */
#ifndef _EMVDCTAG_H
#define _EMVDCTAG_H

/* TAG OF THE EMV'96 SPECIFICATION */

/** @defgroup ExtTags External Tags Definition
 *  @{											*/
#define TAG_ACQUIRER_IDENTIFIER				0x9F01
#define LEN_ACQUIRER_IDENTIFIER				6
#define TAG_ADD_TERMINAL_CAPABILITIES		0x9F40
#define LEN_ADD_TERMINAL_CAPABILITIES		5
#define TAG_AEF_DATA_TEMPLATE				0x70
#define TAG_AMOUNT_AUTH_BIN					0x81
#define TAG_AMOUNT_AUTH_NUM					0x9F02
#define TAG_AMOUNT_OTHER_BIN				0x9F04
#define TAG_AMOUNT_OTHER_NUM				0x9F03
#define TAG_AMOUNT_REFERENCE_CURRENCY_BIN	0x9F3A
#define TAG_APPLI_CRYPTOGRAMME_AC			0x9F26
#define TAG_APPLI_CURRENCY_CODE				0x9F42
/*#define TAG_APPLI_CURRENCY_CODE_VISA		0x9F51 fixed 2cj012*/
#define TAG_APPLI_CURRENCY_EXPONENT			0x9F44
#define TAG_APPLI_DEFAULT_ACTION			0x9F52
#define TAG_APPLI_DISCRETIONARY_DATA		0x9F05
#define TAG_APPLI_EFFECTIVE_DATE			0x5F25
#define TAG_APPLI_EXPIRATION_DATE			0x5F24
#define TAG_AFL								0x94
#define LEN_AFL								252
#define TAG_AID_ICC							0x4F
#define TAG_AID_TERMINAL					0x9F06

#ifndef LEN_AID
#define LEN_AID								16
#endif

#define TAG_AIP								0x82
#define LEN_AIP								2
#define TAG_APPLICATION_LABEL				0x50
#define TAG_APPLICATION_PREFFERRED_NAME		0x9F12
#define TAG_APPLI_PRIM_ACCOUNT_NB			0x5A	/* Application primary account number (PAN) */
#define TAG_APPLI_PRIM_ACCOUNT_NB_SEQ_NB	0x5F34  /* Application primary account number (PAN) sequence number */
#define TAG_APPLI_PRIOR_IND					0x87	/* application priority indicator */
#define TAG_APPLI_REF_CURRENCY				0x9F3B
#define TAG_APPLI_REF_CURRENCY_EXPONENT		0x9F43
#define TAG_APPLI_TEMPLATE					0X61
#define TAG_ATC								0x9F36
#define TAG_APPLI_USAGE_CONTROL				0x9F07
#define TAG_VERSION_NUMBER_ICC				0x9F08
#define TAG_VERSION_NUMBER_TERMINAL			0x9F09
#define TAG_AUTHORISATION_CODE				0x89
#define TAG_AUTHORISATION_RESPONSE_CODE		0x8A
#define TAG_CPLC_STRING						0x9F7F
#define TAG_CDOL1							0x8C
#define TAG_CDOL2							0x8D
#define TAG_CARDHOLDER_NAME					0x5F20
#define TAG_CARDHOLDER_NAME_EXT				0x9F0B
#define TAG_CVM_LIST						0x8E
#define TAG_CVR_RESULT						0x9F34
#define LEN_CVR								3
#define TAG_CERT_AUTH_PUB_KEY_INDEX_ICC		0x8F
#define TAG_CERT_AUTH_PUB_KEY_INDEX_TERM	0x9F22
#define TAG_COMMAND_TEMPLATE				0x83
#define TAG_COMMAND_TO_PERFORM				0x52
#define TAG_CRYPTOGRAM_INFORMATION_DATA		0x9F27
#define TAG_CUMUL_TOTAL_TRANS_AMOUNT_LIMIT	0x9F54
#define TAG_DATA_AUTH_CODE					0x9F45
#define TAG_DF_NAME							0x84
#define TAG_DIRECTORY_DEF_FILE_NAME			0x9D
#define TAG_DIRECTORY_DISCRET_TEMPLATE		0x73
#define TAG_DDOL							0x9F49
#define TAG_FCI_ISSUER_DISCRET_DATA			0xBF0C
#define TAG_FCI_ISSUER_PROPRIET_TEMPLATE	0xA5
#define TAG_FCI_TEMPLATE					0x6F
#define TAG_GEO_INDIC						0x9F55
#define TAG_ICC_DYNAMIC_NUMBER				0x9F4C
#define TAG_ICC_PIN_ENCIPH_PUB_KEY_CERT		0x9F2D
#define TAG_ICC_PIN_ENCIPH_PUB_KEY_EXP		0x9F2E
#define TAG_ICC_PIN_ENCIPH_PUB_KEY_REM		0x9F2F
#define TAG_ICC_PUB_KEY_CERT				0x9F46
#define TAG_ICC_PUB_KEY_EXP					0x9F47
#define TAG_ICC_PUB_KEY_REM					0x9F48
#define TAG_IFD_SERIAL_NUMBER				0x9F1E
#define TAG_ISSUER_ACTION_CODE_DEFAULT		0x9F0D
#define TAG_ISSUER_ACTION_CODE_DENIAL		0x9F0E
#define TAG_ISSUER_ACTION_CODE_ONLINE		0x9F0F
#define TAG_ISSUER_APPLICATION_DATA			0x9F10
#define TAG_ISSUER_AUTH_DATA				0x91
#define TAG_ISSUER_AUTH_INDIC				0x9F56
#define TAG_ISSUER_CODE_TABLE_INDEX			0x9F11
#define TAG_ISSUER_COUNTRY_CODE				0x5F28
#define TAG_ISSUER_COUNTRY_CODE_VISA		0x9F57
#define TAG_ISSUER_PUBLIC_KEY_CERT			0x90
#define TAG_ISSUER_PUBLIC_KEY_EXP			0x9F32
#define TAG_ISSUER_PUBLIC_KEY_REM			0x92
#define TAG_ISSUER_SCRIPT_COMMAND			0x86
#define TAG_ISSUER_SCRIPT_IDENTIFIER		0x9F18
#define LEN_SCRID							0x04
#define TAG_ISSUER_SCRIPT_TEMPLATE_1		0x71
#define TAG_ISSUER_SCRIPT_TEMPLATE_2		0x72
#define TAG_LANGUAGE_PREFERENCE				0x5F2D
#define TAG_LAST_ONLINE_ATC					0x9F13
#define TAG_LOW_CONS_OFF_LIMIT				0x9F14
#define TAG_LOW_CONS_OFF_LIMIT_VISA			0x9F58
#define TAG_MERCHANT_CATEGORY_CODE			0x9F15
#define TAG_MERCHANT_IDENTIFIER				0x9F16
#define TAG_PIN_TRY_COUNTER					0x9F17
#define TAG_POS_ENTRY_MODE_CODE				0x9F39
#define TAG_PDOL							0x9F38
#define TAG_RGPO_FORMAT1					0x80
#define TAG_RGPO_FORMAT2					0x77
#define TAG_RINT_FORMAT1					0x80
#define TAG_RINT_FORMAT2					0x77
#define TAG_SERVICE_CODE					0x5F30
#define TAG_SFI								0x88
#define TAG_SIGNED_DYNAMIC_APPLI_DATA		0x9F4B
#define TAG_SIGNED_STATIC_APPLI_DATA		0x93
#define TAG_STATIC_DATA_AUTH_TAG_LIST		0x9F4A
#define TAG_TERMINAL_CAPABILITIES			0x9F33
#define LEN_TERMINAL_CAPABILITIES			0x3
#define TAG_TERMINAL_COUNTRY_CODE			0x9F1A
#define LEN_TERMINAL_COUNTRY_CODE			0x2
#define TAG_TERMINAL_FLOOR_LIMIT			0x9F1B
#define TAG_TERMINAL_IDENTIFICATION			0x9F1C
#define LEN_TERMINAL_IDENTIFICATION			0x8
#define TAG_TERMINAL_RISK_MANAGMENT_DATA	0x9F1D
#define TAG_TERMINAL_TYPE					0x9F35
#define LEN_TERMINAL_TYPE					0x1
#define TAG_TVR								0x95
#define LEN_TVR								0x5
#define TAG_TRACK1_DISCRET_DATA				0x9F1F
#define TAG_TRACK2_DISCRET_DATA				0x9F20
#define TAG_TRACK2_EQU_DATA					0x57
#define TAG_TDOL							0x97
#define TAG_TC_HASH_VALUE					0x98
#define TAG_TRANSACTION_CURRENCY_CODE		0x5F2A
#define TAG_TRANSACTION_CURRENCY_EXP		0x5F36
#define TAG_TRANSACTION_DATE				0x9A
#define TAG_TRANSACTION_PIN_DATA			0x99
#define TAG_TRANSACTION_REF_CURRENCY_CODE	0x9F3C
#define TAG_TRANSACTION_REF_CURRENCY_EXP	0x9F3D
#define TAG_TRANSACTION_SEQ_COUNTER			0x9F41
#define LEN_TRANSACTION_SEQ_COUNTER			0x4

#define TAG_TSI								0x9B
#define LEN_TSI								0x2
#define TAG_TRANSACTION_TIME				0x9F21
#define TAG_TRANSACTION_TYPE				0x9C
#define TAG_UNPREDICTABLE_NUMBER			0x9F37
#define TAG_UPPER_CONS_OFFLINE_LIMIT		0x9F23

#define TAG_UPPER_CONS_OFFLINE_LIMIT_VISA	0x9F59

#define TAG_ANUFACT_DATA					0xDF50

// #define TAG_TRANSACTION_CATEGORY_CODE		0x9F53


/*& BEGIN FT/937/06/MA : Get transaction Log from ICC for PBOC			   */
#define TAG_LOG_ENTRY						0x9F4D
#define TAG_LOG_FORMAT						0x9F4F
/*& END FT/937/06/MA : Get transaction Log from ICC for PBOC			   */

/*& BEGIN FT/1126/06/MA : Account Type Selection						   */
#define TAG_ACCOUNT_TYPE					0x5F57
#define TAG_IBAN							0x5F53
/*& END   FT/1126/06/MA : Account Type Selection						   */

/* &BEGIN tedt/z3/01/1549/ma tags proprietares
#define TAG_CONSECUTIVE_TRANSACTION_LIMIT	0x9F53
#define TAG_CUMUL_TOTAL_TRANS_AMOUNT_LIMIT	0x9F54
#define TAG_GEO_INDIC						0x9F55
#define TAG_ISSUER_AUTH_INDIC				0x9F56
#define TAG_ISSUER_COUNTRY_CODE_VISA		0x9F57

*/
/** @} */ // end of External Tags Definition

/********************************/
/****	Tag of the terminal	 ****/
/********************************/
/** @defgroup IntTags Internal Tags Definition
 *  @{											*/
/**!
	 Status of the service code. See Service Status Code values definition */
#define TAG_SERVICE_STATUS_CODE				0x9F8101
/** @def TAG_LAST_APDU_CMD_RESPONSE
 * @brief Last Instruction code, and response

	- Byte 1: CLA
	- Byte 2: INS
	- Byte 3: P1
	- Byte 4: P2
	- Byte 5: SW1
	- Byte 6: SW2	*/
#define TAG_LAST_APDU_CMD_RESPONSE			0x9F8102
#define LEN_LAST_APDU_CMD_RESPONSE			0x6
/**!
	 Response Code of EMV Level 1 to the last command. See SDK 30 documentation */
#define TAG_LAST_APDU_RES					0x9F8103
#define LEN_LAST_APDU_RES					0x1
#define TAG_ICC_APPLICATION_WARNING			0x9F8104	/**< Used in french application only */
#define TAG_LOCATED_ERROR					0x9F8105
#define TAG_EMV_ERROR						0x9F8106	/**< Internal use only : Do not use */
#define TAG_COMPONENT_VERSION				0x9f8107	/**< Obsolete value : Do not use */
#define TAG_UNPREDICTABLE_ICC_NUMBER		0x9F8108	/**< Unpredictable value given by the ICC in response to a GET_CHALLENGE command */
/**@def TAG_COMPONENT_ID
 * @brief EMVDC Component identification on 11 bytes

	- CRC on 2 bytes
	- Component type on 1 byte
	- Component name on 8 bytes 	*/
#define TAG_COMPONENT_ID					0x9f8109
/**@def TAG_AID_LIST_TERMINAL
 * @brief List of AID managed by the termina

 This list is given in entry to the application selection step
 It is a concatened list of AID with :
	- len : AID length on one byte. The most significant bit is dedicated to ASI
		- 0 : partial AID allowed
		- 1 : partial AID not allowed
	- AID : Application Identifier	*/
#define TAG_AID_LIST_TERMINAL				0x9F8110
/**@def TAG_ICC_EMV_DC_OPTION
 * @brief Special options to be applied to the transaction.

  value on 2 bytes :
	- Byte 1:
		- bit 8:	Merchant force online choice
		- bit 7:	Merchant force decline: AAC instead of ARQC in Gen AC
		- bit 6:	Merchant force Offline approved instead of Offline declined
		- Other bits : RFU
	- Byte 2: RFU	*/
#define TAG_ICC_EMV_DC_OPTION				0x9f8111
#define TAG_CUMUL_AMOUNT								0x9F8112	/**< Indicates the cumulative transaction amount for the current card */
/**@def TAG_EXCEPTION_FILE_RESULT
 * @brief Result of exception file control

  value on 1 byte :
	- 0 : ICC not found in exception fie
	- 1 : ICC found	*/
#define TAG_EXCEPTION_FILE_RESULT						0x9F8113
#define TAG_AUTH_REQUEST_INTERF							0x9F8114	/**< Internal use only : Do not use */
#define TAG_AUTH_REQUEST_SERVICE						0x9F8115	/**< Internal use only : Do not use */
#define TAG_CARDHOLDER_CONFIRMATION			0x9f8116
#define TAG_NUMBER_OF_MATCHING_APP			0x9f8117	/**< Number of matching application between the terminal and the card */
#define TAG_APP_LABEL_DISPLAYED				0x9f8118	/**< Internal use only : Do not use */
#define TAG_TAA_RESULT						0x9f8119	/**< Result on TAA step as defined in EMV 2000, Book 3 6.7, on one byte */
#define TAG_AUTHORISATION_RESULT			0x9f811A	/**< Issuer decision on one byte : 0 declined, 1 accepted */
#define TAG_LAST_CVM_CODE					0x9f811B	/**< Last CVM method examined, on one byte */
#define TAG_TIME_OUT_PIN_CODE				0x9f811C	/**< Obsolete value : Do not use */
#define TAG_TIME_OUT_INTER_CAR				0x9f811D	/**< Obsolete value : Do not use */
#define TAG_PIN_MINIMUM						0x9f811E	/**< Used in french application only */
#define TAG_INPUT_PIN_STATE					0x9f811F	/**< Internal use only : Do not use */

#define TAG_CERT_AUTH_PUB_KEY                           0x9F8120	/**< Obsolete value : Do not use */
#define TAG_CERT_AUTH_PUB_KEY_CHECKSUM                  0x9F8121	/**< SHA on Certification Authority Public Key. Length = 20 */
#define TAG_CERT_AUTH_PUB_KEY_EXPONENT                  0x9F8122	/**< Certification Authority Exponent. Length = 1 for exp 3, Length = 3 for exp 56537 */
#define TAG_CERT_AUTH_PUB_KEY_MODULUS                   0x9F8123	/**< Certification Authority Modulus */
#define TAG_DEFAULT_DDOL                                0x9F8124	/**< Default Dynamic Data Authentication Data Object List (DDOL). See EMV 2000 book 3 1.4 */
#define TAG_DEFAULT_TDOL                                0x9F8125	/**< Default Transaction Certificate Data Object List (TDOL). See EMV 2000 book 3 1.4 */
#define TAG_MAX_TARG_PERC_FOR_BIASED_RAND_SEL           0x9F8126	/**< Maximum Target Percentage to be Used for Biased Random Selection. One binary byte from 0 to 99 */
#define TAG_TARG_PERC_FOR_BIASED_RAND_SEL               0x9F8127	/**< Target Percentage to Be Used for Random Selection. One binary byte from 0 to 99 */
#define TAG_TERMINAL_ACTION_CODE_DEFAULT                0x9F8128	/**< Terminal Action Code Default. See EMV 2000, Book3 6.7 */
#define TAG_TERMINAL_ACTION_CODE_DENIAL                 0x9F8129	/**< Terminal Action Code Denial. See EMV 2000, Book3 6.7 */
#define TAG_TERMINAL_ACTION_CODE_ONLINE                 0x9F812A	/**< Terminal Action Code Online. See EMV 2000, Book3 6.7 */
#define TAG_TRESH_VALUE_FOR_BIASED_RAND_SEL             0x9F812B	/**< Threshold Value for Biased random Selection. See EMV 2000, Book3 6.6.2 */
#define TAG_TRANSACTION_REF_CURRENCY_CONV               0x9F812C	/**< Transaction Reference Currency Conversion (Not used in current version of EMVDC */
#define TAG_ISSUER_SCRIPT_RESULT						0x9F812D	/**< Issuer Script Result for one script. Length on 5 bytes. See EMV 2000, Book 4, Annex A5 */
#define LEN_ISR											0x05
/**@def TAG_ISSUER_SCRIPT_LIST
 * @brief Encapsulation tag for one Issuer Script

  Value for this tag is :
	- First Byte	: Script Temblate (71 or 72)
	- Second Byte	: Script length
	- Other bytes	: script value.	*/
#define TAG_ISSUER_SCRIPT_LIST							0x9F812E
#define TAG_ISSUER_SCRIPT_RESULT_LIST					0x9F812F	/**< Issuer Script Result List. See EMV 2000, Book 4, Annex A5 */
#define TAG_HISTORICAL_BYTES							0x9f8130	/**< Historical bytes after Power on. See EMV 2000, Book 1 */
/**@def TAG_RESULT_ANALISYS_TAC_DEFAULT
 * @brief Result of Terminal Action Analysis performed on TAC - Default and IAC - Default
	0 : Declined,
	1 : Approved	*/
#define TAG_RESULT_ANALISYS_TAC_DEFAULT					0x9F8131
#define TAG_ISSUER_SCRIPT_RESULT_LIST_LEN				0x9F8137	/**< Issuer Script Result List. Number of bytes in ISR List */

/**@def TAG_AUTOMATE
 * @brief Result of processing of CVM on the application side (i.e : result of pin entry)

  see automate definitions for detail of the authorised values */
#define TAG_AUTOMATE									0x9F8132
/**@def TAG_STATUS_CVP
 * @brief Current Cardholder Verication Method to be processed

  see automate definitions for detail of the authorised values */
#define TAG_STATUS_CVP									0x9F8133
#define TAG_PIN_CODE									0x9F8134	/**< Pin value (Fill in with dummy bytes, as Pin value is no more accessible */
#define TAG_REMAINING_PIN								0x9F8135	/**< Number of remaining PIN tries */
/**@def TAG_SIGNATURE
 * @brief Indicates whether a signature is required or not

	Length = 1 byte.
	TRUE if signature required */
#define TAG_SIGNATURE									0x9F8136
#define TAG_PIN_ERROR									0x9F8138	/**< Used in french application only */
/**@def TAG_BYPASS_PIN
 * @brief Indicates if the Pin entry bypass is required

	Length = 1 byte.
	TRUE (1) if bypass required */
#define TAG_BYPASS_PIN									0x9F8139
/**@def TAG_SCHEMAS_KSU
 * @brief Identify the type of schemes to be managed.

  Only one scheme is defined up to now : Scheme for PIN presentation
	Length = 4 bytes.
	 */
#define TAG_SCHEMAS_KSU									0x9F813A
#define TAG_PP_OK										0x9F813B	/**< Boolean on one Byte. True if Pinpad is functioning */
#define TAG_MODE 										0x9F813C	/**< Used in french application only */
/**@def TAG_PROPRIETARY_TAGS
 * @brief Enables to give the description of a proprietary tag.

  List of proprietary tag definition, with 8 bytes for each tag :
	- 2 first bytes : Proprietary tag value : (shall be between 9F50 and 9F7F)
	- 2 bytes : tag length in case of fixed length, or 0 if variable length
	- 2 bytes : minimum length. 0 in case of fixed length
	- 2 bytes : maximum length. 0 in case of fixed length
	 */
#define TAG_PROPRIETARY_TAGS							0x9F813D

#define TAG_AID_PROPRIETARY								0x9F8140

/**<  Boolean TRUE for a compatibility with EMV 2000 requirements */
#define TAG_COMPATIBILITY_2000							0x9F8141
#define LEN_COMPATIBILITY_2000							1
/**<  Boolean indicating whether the PSE algorithm shall be used or not */
/* (By default, only the list of AID method is used) */
#define TAG_USE_PSE							            0x9F8142
#define LEN_USE_PSE							            1
/**<  Only useful in the french application */
#define TAG_AID_FAILURE									0x9F8150
/**<  Only useful in the canadian application */
#define TAG_TSC_NOT_MANAGED								0x9F8151


/** @defgroup IntMsg Internal messages  (Obsolete values : Do not Use)
 *  @{											*/
/* tag for the message */
#define TAG_MSG_APPROVED					0x9F8153
#define TAG_MSG_CALL_YOUR_BANK				0x9F8154
/*#define TAG_MSG_CARD_ERROR					0x9F8156*/
#define TAG_MSG_DECLINED					0x9F8157
#define TAG_MSG_ENTER_PIN					0x9F8159
#define TAG_MSG_INCORRECT_PIN				0x9F815a
#define TAG_MSG_NOT_ACCEPTED				0x9F815c
#define TAG_MSG_PIN_OK						0x9F815d
/*#define TAG_MSG_PLEASE_WAIT					0x9F813e*/
#define TAG_MSG_PROCESSING_ERROR			0x9F813f
/*#define TAG_MSG_REMOVE_CARD					0x9F8140*/
#define TAG_MSG_TRY_AGAIN					0x9F8163
/*#define TAG_MSG_CARD_CANNOT_BE_READ			0x9F8170*/
#define TAG_MSG_LAST_PIN_TRY				0x9F8171
#define TAG_MSG_PIN_TRY_LIMIT_EXCEEDED		0x9F8172
#define TAG_MSG_PIN_LENGTH_ERROR			0x9F8173
#define TAG_MSG_PIN_BLOCKED					0x9F8174
#define TAG_MSG_ELECTRICAL_PB				0x9F8175
#define TAG_MSG_COMMS_ERROR					0x9F8176
/** @} */

/** @defgroup ExtOda Tags for externalisation of ODA
 * @warning Do not use, except in case of specific requirements
 *  @{											*/
/*& BEGIN Externalisation ODA 									*/
#define TAG_EXTERNAL_FUNCTION				0x9F8180
#define TAG_ODA_TYPE						0x9F8181
#define TAG_ODA_RESULT						0x9F8182
#define TAG_INPUT_AUTH_DATA					0x9F8183
#define TAG_DDOL_DATA						0x9F8184
/*& END															*/
/** @} */

/* BEGIN tedt/z3/02/1166  authentication records must have tag 70 */
#define TAG_ERROR_SFI_AUTH					0x9F8185

 /*& BEGIN TEDT/Z3/02/1314/PBE */
#define TAG_PIN_EXT_FLAG			0x9F8186
#define TAG_PIN_EXT_ENCIPHER		0x9F8187
 /*& END TEDT/Z3/02/1314/PBE */
/*& BEGIN SMO/ETU/04/20014/LB                                              */
/**<  Data Recovered from the Issuer Public Key Certificate, as defined in */
/* EMV2000, Book 2, Table 4                                                */
#define TAG_IPK_DATA				0x9F8188
/**<  Data Recovered from the SDA, as defined in                           */
/* EMV2000, Book 2, Table 5                                                */
#define TAG_SDA_DATA				0x9F8189
/**<  Data Recovered from the ICC Public Key Certificate, as defined in    */
/* EMV2000, Book 2, Table 10                                               */
#define TAG_ICC_DATA				0x9F818A
/**<  Data Recovered from the DDA, as defined in                           */
/* EMV2000, Book 2, Table 13                                               */
#define TAG_DDA_DATA				0x9F818C
/*& END SMO/ETU/04/20014/LB                                                */
/*& BEGIN SMO/ETU/04/20003/LB                                              */
/**< Special need for EMV probe tools : Add a delay after ATR              */
#define TAG_WAIT_AFTER_ATR					0x9F818D
/*& END SMO/ETU/04/20003/LB                                                */

/* &BEGIN tedt/z3/02/1674/ma EMV2000 specifi for Combo DDA*/
#define TAG_COMBO							0x9F8190
#define TAG_PDOL_VALUES						0x9F8191
#define TAG_CDOL1_VALUES					0x9F8192
#define TAG_CDOL2_VALUES					0x9F8193
#define TAG_GENAC_RESP						0x9F8194
/*& BEGIN TEDT/Z2/03/873/LB                                                */
/**<  Enables to require an alternative option to the PSE algorithm        */
#define TAG_PSE_ALGO						0x9F8195
#define PSE_NORESELECT	0x00	/**< Standard algorithm                    */
#define PSE_RESELECT	0x01	/**< Reselect when resume to previous directory */
/*& END TEDT/Z2/03/873/LB                                                  */
/*& BEGIN SMO/ETU/04/20066/LB                                              */
/**<  In case of CDA, CID recovered from the cerficate                     */
#define TAG_RECOVERED_CID					0x9F8196
/*& END SMO/ETU/04/20066/LB                                                */


/*& BEGIN SMO/ETU/04/20160/MA */
/**<  EMV C_APDU                                                           */
#define TAG_APDU_CMD						0x9F8197
/**<  EMV R_APDU                                                           */
#define TAG_APDU_RESPONSE					0x9F8198
/**<  Absolute tick before the command                                     */
#define TAG_BEGIN_TIMER						0x9F8199
/**<  Absolute tick after the command                                      */
#define TAG_END_TIMER						0x9F819A
/**<  tool ware implemented                                                */
#define TAG_IS_TOOLWARE						0x9F819B
/*& END SMO/ETU/04/20160/MA                                                */

/*& BEGIN SMO/ETU/04/20244/LB                                              */
/**@def TAG_IS_ADVICE_REQUIRED
 * @brief Indicate if an advice messages must be created, when the transaction is declined.
 Do not create an advice when a batch log is created, or when the transaction is
 captured online, even if the tag is set to TRIE.

  Length : 1 byte
	- TRUE : Create an advice if the transaction is declined.
	- FALSE : Don't create an advice.
	 */
#define TAG_IS_ADVICE_REQUIRED				0x9F819C
/*& END SMO/ETU/04/20244/LB                                              */

/*& BEGIN FT/937/06/MA : Get transaction Log from ICC for PBOC			   */
#define TAG_TRLOG_RECORD					0x9F819D
#define TAG_TRLOG_IN_PROGRESS				0x9F81A4
/*& END FT/937/06/MA : Get transaction Log from ICC for PBOC			   */

#define TAG_FORCE_TAA_RESULT				0x9F81AB

/*& BEGIN FT/2006/07/MA :  CDA Modified Terminal Behaviour			   */
#define TAG_CDA_NEVER_REQUEST_ARQC_1GENAC 	0x9F81A7
#define TAG_CDA_NEVER_REQUEST_ONLINE_2GENAC 0x9F81A8
#define TAG_DETECT_FAIL_PRIOR_TAA	    	0x9F81A6
#define TAG_CDA_IN_P1_GENAC1             	0x9F81A5
#define TAG_CDA_IN_P1_GENAC2				0x9F81A9
#define TAG_FORCE_AAC_IN_P1_GENAC2			0x9F81AA

/*& BEGIN FT/2006/07/MA :  CDA Modified Terminal Behaviour			   */

/** @} */ // end of Internal Tags Definition

/*******************************/
/** Service Status Code State **/
/******************************/
/** @defgroup Status Service Status Codes
 *  @{											*/


/* Service Completed Successfully */
#define	TAG_PROCESS_COMPLETED				0x0000		/**< Service Completed Successfully - Nothing Special */
#define	TAG_TRANSACTION_ACCEPTED			0x0001		/**< Service Completed Successfully - Transaction Accepted */
#define TAG_TRANSACTION_DECLINED			0x0002		/**< Service Completed Successfully - Transaction Declined */
#define	TAG_AUTHORISATION_REQUEST			0x0003		/**< Service Completed Successfully - Online Authorisation Requested */
#define	TAG_REFERRAL_REQUEST				0x0004		/**< Service Completed Successfully - Referral Requested */
#define	TAG_VISA_EASY_ENTRY_CARD			0x0005		/**< Service Completed Successfully - Special Case of Visa Easy Entry Cards */
/* &BEGIN tedt/z3/02/1674/ma EMV2000 specifi for Combo DDA*/
#define	TAG_CDA_FAILED						0x0006		/**<  Error during CDA */
/* &END tedt/z3/02/1674/ma EMV2000 specifi for Combo DDA*/


/* Transaction Terminated */
#define TAG_TRANSACTION_CANCELLED			0x0010		/**< Transaction terminated - Obsolete value */
#define TAG_PROCESSING_ERROR				0x0011		/**< Transaction terminated - ICC Protocol error */
#define TAG_CARD_ERROR						0x0012		/**< Transaction terminated - Unexpected Response Code from ICC */
#define	TAG_NOT_ACCEPTED					0x0013		/**< Transaction terminated - Bad Tag given by the card */
#define TAG_ICC_DATA_FORMAT_ERROR			0x0014		/**< Transaction terminated - Format error in a tag value */
#define TAG_MISSING_MANDATORY_ICC_DATA		0x0015		/**< Transaction terminated - Mandatory Data missing in ICC */
#define TAG_ICC_REDUNDANT_DATA				0x0016		/**< Transaction terminated - Redundant Data in ICC */
#define TAG_CARD_BLOCKED					0x0017		/**< Transaction terminated - Card Blocked */
#define TAG_COND_OF_USE_NOT_SATISFIED       0x0018		/**< Transaction terminated - ICC replies Condition of Use not Satisfied to GPO command */
#define TAG_MISSING_MANDATORY_TERM_DATA		0x0019		/**< Transaction terminated - Terminal Parameters Missing */
#define TAG_INTERNAL_ERROR					0x001A		/**< Transaction terminated - Internal Error during Step Processing */
#define TAG_REMOVED_CARD					0x001B		/**< Transaction terminated - Card Removed */
/*&BEGIN FT/06/638/MA : service not allowed in GENAC shall terminate transaction   */
#define TAG_SERVICE_NOT_ALLOWED				0x001C		/**< Transaction terminated - Service Not Allowed */
/*&END FT/06/638/MA : service not allowed in GENAC shall terminate transaction   */

/* Service execution error */
#define	TAG_NOT_ENOUGH_MEMORY				0x0101		/**< Execution Error - Missing Memory */
#define	TAG_WRONG_DEL_INPUT_PARAMETER		0x0102		/**< Execution Error - Bad entry Data */
/** @} */ // end of Status

/** @defgroup automate Cardholder Verification Automate
 *  @{											*/


#define  NO_REMAINING_PIN	52		/**< PIN Try limit Exceeded */
#define  INPUT_PIN_OFF		53		/**< Perform PIN Entry for offline verification */
#define  INPUT_PIN_ON		54		/**< Perform PIN Entry for online verification */
#define  INPUT_PIN_OK		55		/**< PIN entry performed */
#define  NO_INPUT			56		/**< CVM End */
#define  PP_HS				60		/**< Pinpad Out of Services */
#define  CANCEL_INPUT  		61		/**< Pin entry cancelled */
#define  TO_INPUT  			62		/**< Time Out during PIN Entry */
#define  REMOVED_CARD 		63		/**< Card Removed */
#define  ERROR_CARD 		64		/**< Card Error */
#define  MORE		 		65		/**< Internal use only */
/*& BEGIN TEDT/Z3/02/1314/PBE                                              */
#define  ERROR_ENC_DATA		66		/**< Error during PIN Encpherment */
/*& BEGIN TEDT/Z3/02/1314/PBE                                              */
/** @} */ // end of automate

/* Values for TAG_SCHEMAS_KSU */
/*----------------------------*/
/* Default Value : No Treatment made by KSU Scheme              */
#define SCH_NO_FCT			0x00000000
/* Bit 1 : Set to 1 for Pincode Offline Treatment by KSU Scheme */
#define SCH_PINCODE_OFFLINE		0x00000001

/*& BEGIN Externalisation ODA 									*/
#define IS_EXTERNAL_ODA			0x8000
/*& END															*/


/*& BEGIN SMO/ETU/05/20560/MA   : proprietary method for CVM list   */
/* list of proprietary methods supported */
#define TAG_SUPPORTED_PROPRIETARY_LIST     0x9f8145
/* result of the CVM proprietary method applied */
#define TAG_PERFORMED_METHOD  	   		   0x9f8146
#define TAG_RESULT_PROPRIETARY_METHOD  	   0x9f8147
#define PROPRIETARY_METHOD 					   0x50


/*& BEGIN SMO/ETU/05/20560/MA   : proprietary method for CVM list   */
/*&BEGIN FT/06/812/MA : Online-only  terminal type clarification: declare SKIP TAC-IAC Default    */
/**@def TAG_SKIP_TAC_IAC_DEFAULT
 * @brief Indicate if TAC/IAC Default processing has to be skipped for an Online only terminal
 when terminal is unable to succesfully go online. By default ( if this parameter does not exist )
 behaviour is the same as FALSE.

  Length : 1 byte
	- TRUE :  skip TAC/IAC Default processing if conditions are gathered.
	- FALSE : process TAC/IAC Default processing.
	 */
#define  TAG_SKIP_TAC_IAC_DEFAULT			0x9f8148
/*&END FT/06/812/MA : Online-only  terminal type clarification: declare SKIP TAC-IAC Default    */

/*& BEGIN FT/937/06/MA : Get transaction Log from ICC for PBOC			   */
/**@def TAG_TRLOG_RECORD
 * @brief Contains a response of command Read_Record of transaction Log of the ICC.
	 */
#define TAG_TRLOG_RECORD					0x9F819D
/*& END FT/937/06/MA : Get transaction Log from ICC for PBOC			   */


/*&BEGIN FT 1114/MA : release on taa + Custom parameter / terminal type */
/**@def TAG_SKIP_TAC_IAC_ONLINE
 * @brief Indicate if TAC/IAC Online processing has to be skipped for an Offline only terminal
 during Terminal Action analysis. By default ( if this parameter does not exist )
 behaviour is the same as TRUE.

  Length : 1 byte
	- TRUE :  skip TAC/IAC Online processing if conditions are gathered.
	- FALSE : process TAC/IAC Online processing.
	 */
#define  TAG_SKIP_TAC_IAC_ONLINE			0x9F819E

/**@def TAG_FLOOR_LIMIT_CHECKING
 * @brief Indicate if function Floor Limit Checking in TRM has to be done according
 particular terminal type.
 See Book 4 6.4 Conditions for Support of Functions.
 By default ( if this parameter does not exist ) behaviour is the same as TRUE.

  Length : 1 byte
	- TRUE :  processing Floor Limit Checking
	- FALSE : do not process Floor Limit Checking ( if conditions are gathered)
	 */
#define  TAG_FLOOR_LIMIT_CHECKING					0x9F819F

/**@def TAG_RANDOM_TRANSACTION_SELECT
 * @brief Indicate if function Velocity Checking in TRM has to be done according
 particular terminal type.
 See Book 4 6.4 Conditions for Support of Functions.
 By default ( if this parameter does not exist ) behaviour is the same as TRUE.

  Length : 1 byte
	- TRUE :  processing Random Selection
	- FALSE : do not process Random Selection Checking ( if conditions are gathered)
	 */
#define  TAG_RANDOM_TRANSACTION_SELECT					0x9F81A0
/**@def TAG_VELOCITY_CHECKING
 * @brief Indicate if function Velocity Checking in TRM has to be done according
 particular terminal type.
 See Book 4 6.4 Conditions for Support of Functions.
 By default ( if this parameter does not exist ) behaviour is the same as TRUE.

  Length : 1 byte
	- TRUE :  processing Velocity Checking
	- FALSE : do not process velocity Checking ( if conditions are gathered)
	 */
#define  TAG_VELOCITY_CHECKING					0x9F81A1


/**@def TAG_ODA_PROCESSING
 * @brief Indicate if function Offline Data Authentication has to be done according
 particular terminal type.
 See Book 4 6.4 Conditions for Support of Functions.
 By default ( if this parameter does not exist ) behaviour is the same as TRUE.

  Length : 1 byte
	- TRUE :  processing ODA
	- FALSE : do not process ODA ( if conditions are gathered)
	 */
#define  TAG_ODA_PROCESSING					0x9F81A2
/*&END FT 1114/MA : release on TRM + Custom parameter / terminal type */

/*&BEGIN FT 472/MA TRM can be bypassed */
/**@def TAG_TRM_OVERPASS_AIP
 * @brief Indicate if function TRM  has to be done even if AIP value does not indicate TRM to do.
 See book 3 chapter 10.6
 By default ( if this parameter does not exist ) behaviour is the same as FALSE.

  Length : 1 byte
	- TRUE :  perform TRM even if AIP not set
	- FALSE : else
	 */
#define TAG_TRM_OVERPASS_AIP		   0x9F81A3	/**< Boolean TRM to be done without testing AIP if TRUE */


/** @} */ // end of Internal Tags Definition

/*******************************/
/** Service Status Code State **/
/******************************/
/** @defgroup Status Service Status Codes
 *  @{											*/

/*& BEGIN SMO/ETU/05/20560/MA   : proprietary method for CVM list   */
/* list of proprietary methods supported */
#define TAG_SUPPORTED_PROPRIETARY_LIST     0x9f8145
/* result of the CVM proprietary method applied */
#define TAG_PERFORMED_METHOD  	   		   0x9f8146
#define TAG_RESULT_PROPRIETARY_METHOD  	   0x9f8147
#define PROPRIETARY_METHOD 					   0x50


/*& END SMO/ETU/05/20560/MA   : proprietary method for CVM list   */

/* Attended Environment */
#define ONLINE_ONLY_ATTENDED_FINANCIAL 		0x11
#define ONLINE_ONLY_ATTENDED_MERCHANT 		0x21
#define OFFLINE_ONLINE_ATTENDED_FINANCIAL 	0x12
#define OFFLINE_ONLINE_ATTENDED_MERCHANT 	0x22
#define OFFLINE_ONLY_ATTENDED_FINANCIAL 	0x13
#define OFFLINE_ONLY_ATTENDED_MERCHANT 		0x23

/* Unattended Environment */
#define ONLINE_ONLY_UNATTENDED_FINANCIAL 	0x14
#define ONLINE_ONLY_UNATTENDED_MERCHANT 	0x24
#define OFFLINE_ONLINE_UNATTENDED_FINANCIAL 0x15
#define OFFLINE_ONLINE_UNATTENDED_MERCHANT 	0x25
#define OFFLINE_ONLY_UNATTENDED_FINANCIAL 	0x16
#define OFFLINE_ONLY_UNATTENDED_MERCHANT 	0x26

/*&END FT/06/812/MA : see SU #51  Online-only terminals clarifications         */


/*& BEGIN FT/1126/06/MA : Account Type Selection						   */
#define  ACCOUNT_TYPE_DEFAULT 			0x00
#define  ACCOUNT_TYPE_SAVINGS 			0x10
#define  ACCOUNT_TYPE_CHEQUE_DEBIT 		0x20
#define  ACCOUNT_TYPE_CREDIT 			0x30
/*& END FT/1126/06/MA : Account Type Selection						   */

/*&BEGIN FT/07/2147/MA : bad comparison between CID and control parameter */
#define TAC_DEFAULT_REJECT     0
#define TAC_DEFAULT_APPROVE    1
/*&END FT/07/2147/MA : bad comparison between CID and control parameter */



/** @} */

#endif
